package com.ask.javabagubooster.a_java_basis.juc.IdGenerator;

import java.util.concurrent.atomic.AtomicLong;

public class IdGenerator_V1 {
    private static int currentId = 0;
    // synchronized 保证线程安全
    public synchronized static int nextId() {
        currentId++;
        return currentId;
    }

}
